<%@ page contentType="text/html;charset=UTF-8" isErrorPage="true" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <title>Error Page</title>
    <%@ include file="/common/meta.jsp" %>
    <link rel="stylesheet" href="<c:url value="/styles/error.css"/>" type="text/css">
    <script src="<c:url value="/scripts/prototype.js"/>" type="text/javascript"></script>

    <script type="text/javascript">
        function showDetail() {
            $('errMsgDetail').toggle();
        }
    </script>
</head>

<body>

<div id="errMsg">
    <%

        if (exception != null) //from JSP
        {
            String requestUri = (String) request.getAttribute("javax.servlet.error.request_uri");
        }
        else if (request.getAttribute("exception") != null) //from Spring
        {
            exception = (Exception) request.getAttribute("exception");
        }
    %>

    <h1>系统运行期错误: </h1>
    <pre><%=exception.getMessage()%>
    </pre>
    <br>

    <p><a href="#" onclick="showDetail();">点击查看详细错误信息</a></p>

    <div id="errMsgDetail" style="display:none">
        <pre><%exception.printStackTrace(new java.io.PrintWriter(out));%></pre>
    </div>
</div>
</body>
</html>